<h2>Sửa thông tin sản phẩm</h2>
<script type="text/javascript">
	function Huy()
	{
		location.href = "./index.php?act=2";	
	}
</script>
     <?php
	 	if(!isset($_GET["id"]))
			header("location:index.php?act=2");
			
		$id = $_GET["id"];
		$sql = "SELECT * FROM dt WHERE madt = ".$id;
		$result = DataProvider::ExecuteQuery($sql);
		$row = mysql_fetch_array($result);
	 ?>
         <div class="form">
         <form action="./pages/sanpham/xlCapNhat.php" method="post" enctype="multipart/form-data" class="niceform">
         		<input type="hidden" name="madt" value="<?php echo $row["madt"]; ?>" />
                <fieldset>
                    <dl>
                        <dt><label for="email">Tên điện thoại:</label></dt>
                        <dd><input type="text" name="ten" id="" size="54" value="<?php echo $row["tendt"]; ?>" /></dd>
                    </dl>
                    <dl>
                        <dt><label for="email">Thông tin chi tiết:</label></dt>
                        <dd><input type="text" name="thongtinchitiet" id="" size="54" value="<?php echo $row["thongtinchitiet"]; ?>" /></dd>
                    </dl>
                    <dl>
                        <dt><label for="gender">Nhà sản xuất:</label></dt>
                        <dd>
                            <select size="1" name="nsx" id="">
                            	<?php
									$sql = "SELECT * FROM nhasanxuat";
									$result = DataProvider::ExecuteQuery($sql);
									while($dong = mysql_fetch_array($result))
									{
										if($dong["manhasanxuat"] == $row["manhasanxuat"])
										{
											?>
                                        	<option value="<?php echo $dong["manhasanxuat"]; ?>" selected="selected"><?php echo $dong["tennhasanxuat"];?></option>
                                        	<?php
										}
										else
										{
											?>
                                        	<option value="<?php echo $dong["manhasanxuat"]; ?>"><?php echo $dong["tennhasanxuat"];?></option>
                                        	<?php
										}
												
									}
								?>
                            </select>
                        </dd>
                    </dl>
                    
                    <dl>
                        <dt><label for="gender">Loại sản phẩm:</label></dt>
                        <dd>
                            <select size="1" name="loai" id="">
                            	<?php
									$sql = "SELECT * FROM loaisanpham";
									$result = DataProvider::ExecuteQuery($sql);
									while($dong = mysql_fetch_array($result))
									{
										if($dong["maloaisanpham"] == $row["maloaisanpham"])
										{
											?>
                                        	<option value="<?php echo $dong["maloaisanpham"]; ?>" selected="selected"><?php echo $dong["tenloaisanpham"];?></option>
                                        	<?php
										}
										else
										{
											?>
                                        	<option value="<?php echo $dong["maloaisanpham"]; ?>"><?php echo $dong["tenloaisanpham"];?></option>
                                        	<?php
										}
												
									}
								?>
                            </select>
                        </dd>
                    </dl>
                    
                    <dl>
                        <dt><label for="email">Gia:</label></dt>
                        <dd><input type="text" name="gia" id="" size="54" value="<?php echo $row["gia"]; ?>" /></dd>
                    </dl>    
                    <dl>
                        <dt><label for="email">Xuất sứ:</label></dt>
                        <dd><input type="text" name="xuatxu" id="" size="54" value="<?php echo $row["xuatxu"]; ?>" /></dd>
                    </dl>             
                    <dl>
                        <dt><label for="upload">Hình ảnh:</label></dt>
                        <dd>
                        	<input type="file" name="hinh" id="hinh"/> <br />
                        	<img src="../<?php echo $row["hinh"]; ?>" width="200" />
                        </dd>
                    </dl>
                    
                    
                    
                     <dl class="submit">
                    <input type="submit" name="submit" id="submit" value="Submit" />
                    <input type="button"  value="Hủy thao tác" onClick="Huy();" />
                     </dl>

                </fieldset>
                
         </form>
         </div>